//
//  CFProgressHUDImageIndicatorView.m
//  CFProgressHUD
//
//  Created by 千域互联 on 2018/3/18.
//  Copyright © 2018年 千域互联. All rights reserved.
//

#import "CFProgressHUDImageIndicatorView.h"

@implementation CFProgressHUDImageIndicatorView

- (instancetype)initWithImage:(UIImage *)image
{
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    self = [super initWithContentView:imageView];
    return self;
}

- (instancetype)initWithAnimatedImages:(NSArray<UIImage *> *)images
{
    UIImage *animatedImage = images.firstObject;
    
    UIImageView *animatedImageView = [[UIImageView alloc] initWithImage:animatedImage];
    animatedImageView.animationImages = images.copy;
    animatedImageView.animationDuration = images.count / 24;
    animatedImageView.animationRepeatCount = -1;
    [animatedImageView startAnimating];
    
    self = [super initWithContentView:animatedImageView];
    return self;
}

@end
